{% extends "score/base.html" %}

{% block title %}{{ title }} - ExamPulse{% endblock %}

{% block score_content %}
<div class="row justify-content-center">
    <div class="col-md-6">
        <div class="card border-danger">
            <!-- 卡片头部：红色警示风格 -->
            <div class="card-header bg-danger text-white">
                <h4 class="mb-0">
                    <i class="fas fa-exclamation-triangle me-2"></i>{{ title }}
                </h4>
            </div>
            
            <!-- 卡片内容：确认信息 -->
            <div class="card-body">
                <p class="lead">您确定要删除以下成绩记录吗？此操作不可撤销！</p>
                
                <!-- 显示要删除的成绩详情 -->
                <div class="card mb-3">
                    <div class="card-body">
                        <h5 class="card-title">
                            <i class="fas fa-graduation-cap me-1"></i>{{ exam_record.subject.name }}
                        </h5>
                        <ul class="list-unstyled">
                            <li><strong>考试名称：</strong>{{ exam_record.exam.name }}</li>
                            <li><strong>考试日期：</strong>{{ exam_record.exam.exam_date }}</li>
                            <li><strong>得分：</strong>{{ exam_record.score }} / {{ exam_record.subject.full_score }} 分</li>
                            {% if exam_record.exam_duration %}
                            <li><strong>考试用时：</strong>{{ exam_record.exam_duration }} 分钟</li>
                            {% endif %}
                            <li><strong>记录创建时间：</strong>{{ exam_record.created_at|date:"Y-m-d H:i" }}</li>
                        </ul>
                    </div>
                </div>
                
                <!-- 操作按钮：删除/取消 -->
                <form method="post">
                    {% csrf_token %}
                    <div class="d-grid gap-2 d-md-flex justify-content-md-end">
                        <!-- 确认删除：红色按钮 -->
                        <button type="submit" class="btn btn-danger">
                            <i class="fas fa-trash-alt me-1"></i>确认删除
                        </button>
                        <!-- 取消删除：返回列表 -->
                        <a href="{% url 'score:score_list' %}" class="btn btn-outline-secondary ms-2">
                            <i class="fas fa-times me-1"></i>取消
                        </a>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
{% endblock %}